﻿cmake_minimum_required(VERSION 3.14)

project(rsa_ssl LANGUAGES CXX)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
find_package(Qt5 REQUIRED COMPONENTS Gui)
find_package(Qt5 REQUIRED COMPONENTS Widgets)

include_directories("D:/OpenSSL-Win64/include")
link_directories("D:/OpenSSL-Win64/lib/VC/x64/MDd")

add_executable(rsa_ssl
  main.cpp
  Codecs.h Codecs.cpp
)
target_link_libraries(rsa_ssl Qt${QT_VERSION_MAJOR}::Core libssl libcrypto)
target_link_libraries(rsa_ssl Qt${QT_VERSION_MAJOR}::Gui)
target_link_libraries(rsa_ssl Qt${QT_VERSION_MAJOR}::Widgets)

include(GNUInstallDirs)
install(TARGETS rsa_ssl
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
